package com.niit.sequenceFile.read;

import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

/**
 * @author:Yan
 * @date: 2022年08月13日 20:41
 * @desc:
 */
public class ReadSeqFileAppMapper extends Mapper<NullWritable, Text, NullWritable, Text> {

    private NullWritable outputKey;

    @Override
    protected void setup(Context context) throws IOException, InterruptedException {
        this.outputKey = NullWritable.get();
    }

    @Override
    protected void map(NullWritable key, Text value, Context context) throws IOException, InterruptedException {
        context.write(outputKey, value);
    }

    @Override
    protected void cleanup(Context context) throws IOException, InterruptedException {
        this.outputKey = null;
    }
}
